package cn.mdmm.web.context;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.ContextLoaderListener;


/**
 * 系统启动时加载
 * @version 1.0
 */
public class DbContextLoaderListener extends ContextLoaderListener implements ServletContextListener {

	protected static final Logger logger = LoggerFactory.getLogger(DbContextLoaderListener.class);
	
	@Override
	public void contextDestroyed(ServletContextEvent event) { 
		super.contextDestroyed(event);
	}
	 
	 
	public void contextInitialized(ServletContextEvent event) {
		System.setProperty("org.terracotta.quartz.skipUpdateCheck", "true");
		super.contextInitialized(event);
		
		ServletContext sc = event.getServletContext();
		
		if (sc != null){
			ObjectFactory.getInstance(sc);
		}
		SystemCache.cacheAllDict();
	}
}
